package com.group.seckill.config;


import org.springframework.context.annotation.Configuration;

/**
 * @author lins
 * @date 2021/11/16 13:51
 */
@Configuration
public class SentinelConfig {
    public SentinelConfig(){
//        WebCallbackManager.setUrlBlockHandler(new UrlBlockHandler() {
//            @Override
//            public void blocked(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, BlockException e) throws IOException {
//                R r = R.error(BizCodeEnum.SENTINEL_EXCEPTION.getCode(), BizCodeEnum.SENTINEL_EXCEPTION.getMessage());
//                String error = JSON.toJSONString(r);
//                httpServletResponse.setCharacterEncoding("UTF-8");
//                httpServletResponse.setContentType("application/json");
//                httpServletResponse.getWriter().write(error);
//            }
//        });
    }
}
